<include file="Public/min-header" />
<section class="wrapper">
    <div class="row">
        <div class="col-xs-12">
            <div class="panel paperHeiWid1">  
                <div class="panel-heading"><i class="icon-key"></i>修改密码
                    <span class="pull-right">
                      <button type="button" class="btn btn-default btn-xs" onclick="javascript:window.history.back();return false;"><i class="icon-reply"></i>返回</button>
                    </span>
                </div>
                <div class="panel-body">   
                    <!--表单数据-->
                    <form method="post" id="adminHandle" action="" class="tab-content">  
                        <div class="form-group">                                        
                            <label class="col-lg-2 col-xs-3 control-label">原密码</label>
                            <div class="col-lg-5 col-xs-10">
                                <input type="password" class="form-control" name="ypassword" maxlength="16" placeholder="请输入原密码" />
                            </div>                                                       
                        </div>
                        <div class="form-group">                                        
                            <label class="col-lg-2 col-xs-3 control-label">新密码</label>
                            <div class="col-lg-5 col-xs-10">
                                <input type="password" class="form-control" name="password" maxlength="16" placeholder="密码在16位以内" />
                            </div>                                                       
                        </div>      
                        <div class="form-group">                                        
                            <label class="col-lg-2 col-xs-3 control-label">再次确认新密码</label>
                            <div class="col-lg-5 col-xs-10">
                                <input type="password" class="form-control" name="password2" maxlength="16" placeholder="请再次输入新密码" />
                            </div>                                                       
                        </div>  
                        <div class="pull-right">
                            <input class="btn btn-submit" type="button" onclick="adsubmit()" value="保存" />
                        </div>            
                        <!-- <div class="tab-pane active" id="tab_tongyong">-->                       
			    	</form><!--表单数据-->
                </div>
            </div>
        </div>
    </div>
</section>
<script>
function adsubmit(){
	var ypas = $("input[name='ypassword']").val();
	var pas = $("input[name='password']").val();
	var pas2 = $("input[name='password2']").val();
	if(ypas == ''){
		layer.msg('原密码不能为空!', {icon: 2,time: 1000});  
		return false;
	}
	if(pas == ''){
		layer.msg('密码不能为空!', {icon: 2,time: 1000});  
		return false;
	}
	if(pas2 == ''){
		layer.msg('请再次输入密码！', {icon: 2,time: 1000});
		return false;
	}
	if(pas != pas2){
		layer.msg('两次密码输入不一致！', {icon: 2,time: 1000});//alert('少年，密码不能为空！');
		return false;
	}
	
    $.ajax({
        type : "POST",
        url:'__URL__/editpwd',
        data : {pas:pas,ypas:ypas},
        dataType : 'json',
        success: function(res){
        	if(res.status==0){
				layer.alert(res.info, {icon: 2});
				return;
			 }
       	     if(!res.errNo){
				layer.msg(res.msg, {icon: 1,time: 1000});
              setTimeout("location.href='/Admin/logout'",2000);
	         }else{
	        	 layer.msg(res.msg, {icon: 2,time: 1000});
	         }
        }
    });
}
</script>
</body>
</html>